home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / ControlStrip.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  7.8 KB  |  243 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ControlStrip.h
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    ControlStrip 1.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CONTROLSTRIP__
  18. #define __CONTROLSTRIP__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __MENUS__
  24. #include <Menus.h>
  25. #endif
  26. #ifndef __DIALOGS__
  27. #include <Dialogs.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. /*********************************************************************************************
  53.  
  54.     messages passed to the modules
  55.  
  56. *********************************************************************************************/
  57.  
  58. enum {
  59.     sdevInitModule                = 0,                            /* initialize the module*/
  60.     sdevCloseModule                = 1,                            /* clean up before being closed*/
  61.     sdevFeatures                = 2,                            /* return feature bits*/
  62.     sdevGetDisplayWidth            = 3,                            /* returns the width of the module's display*/
  63.     sdevPeriodicTickle            = 4,                            /* periodic tickle when nothing else is happening*/
  64.     sdevDrawStatus                = 5,                            /* update the interface in the Control Strip*/
  65.     sdevMouseClick                = 6,                            /* user clicked on the module's display area in the Control Strip*/
  66.     sdevSaveSettings            = 7,                            /* saved any changed settings in module's preferences file*/
  67.     sdevShowBalloonHelp            = 8                                /* puts up a help balloon, if the module has one to display*/
  68. };
  69.  
  70. /*********************************************************************************************
  71.  
  72.     Features supported by the module.  If a bit is set, it means that feature is supported.
  73.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  74.  
  75. *********************************************************************************************/
  76.  
  77. enum {
  78.     sdevWantMouseClicks            = 0,                            /* notify the module of mouseDown events*/
  79.     sdevDontAutoTrack            = 1,                            /* call the module to do mouse tracking*/
  80.     sdevHasCustomHelp            = 2,                            /* module provides its own help messages*/
  81.     sdevKeepModuleLocked        = 3                                /* module needs to be locked in the heap*/
  82. };
  83.  
  84. /*********************************************************************************************
  85.  
  86.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  87.     If a bit is set, the module can request that a specific function is performed by
  88.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  89.     for future use by Apple, and should be set to zero.
  90.  
  91. *********************************************************************************************/
  92.  
  93. enum {
  94.     sdevResizeDisplay            = 0,                            /* resize the module's display*/
  95.     sdevNeedToSave                = 1,                            /* need to save changed settings, when convenient*/
  96.     sdevHelpStateChange            = 2,                            /* need to update the help message because of a state change*/
  97.     sdevCloseNow                = 3                                /* close a module because it doesn't want to stay around*/
  98. };
  99.  
  100.  
  101. /*********************************************************************************************
  102.  
  103.     miscellaneous
  104.  
  105. *********************************************************************************************/
  106.  
  107. enum {
  108.     sdevFileType                = FOUR_CHAR_CODE('sdev')        /* module's file type*/
  109. };
  110.  
  111.  
  112. enum {
  113.     sdevMenuItemMark            = 0xA5                            /* ‘•’: ‘checkmark’ to use in popup menus*/
  114. };
  115.  
  116.  
  117. /*    direction values for SBDrawBarGraph*/
  118.  
  119.  
  120. enum {
  121.     BarGraphSlopeLeft            = -1,                            /* max end of sloping bar graph is on the left*/
  122.     BarGraphFlatRight            = 0,                            /* max end of flat bar graph is on the right*/
  123.     BarGraphSlopeRight            = 1                                /* max end of sloping bar graph is on the right*/
  124. };
  125.  
  126. /*********************************************************************************************
  127.  
  128.     utility routines to provide standard interface elements and support for common functions
  129.  
  130. *********************************************************************************************/
  131. EXTERN_API( Boolean )
  132. SBIsControlStripVisible            (void)                                                        TWOWORDINLINE(0x7000, 0xAAF2);
  133.  
  134. EXTERN_API( void )
  135. SBShowHideControlStrip            (Boolean                 showIt)                                THREEWORDINLINE(0x303C, 0x0101, 0xAAF2);
  136.  
  137. EXTERN_API( Boolean )
  138. SBSafeToAccessStartupDisk        (void)                                                        TWOWORDINLINE(0x7002, 0xAAF2);
  139.  
  140. EXTERN_API( short )
  141. SBOpenModuleResourceFile        (OSType                 fileCreator)                        THREEWORDINLINE(0x303C, 0x0203, 0xAAF2);
  142.  
  143. EXTERN_API( OSErr )
  144. SBLoadPreferences                (ConstStr255Param         prefsResourceName,
  145.                                  Handle *                preferences)                        THREEWORDINLINE(0x303C, 0x0404, 0xAAF2);
  146.  
  147. EXTERN_API( OSErr )
  148. SBSavePreferences                (ConstStr255Param         prefsResourceName,
  149.                                  Handle                 preferences)                        THREEWORDINLINE(0x303C, 0x0405, 0xAAF2);
  150.  
  151. EXTERN_API( void )
  152. SBGetDetachedIndString            (StringPtr                 theString,
  153.                                  Handle                 stringList,
  154.                                  short                     whichString)                        THREEWORDINLINE(0x303C, 0x0506, 0xAAF2);
  155.  
  156. EXTERN_API( OSErr )
  157. SBGetDetachIconSuite            (Handle *                theIconSuite,
  158.                                  short                     theResID,
  159.                                  unsigned long             selector)                            THREEWORDINLINE(0x303C, 0x0507, 0xAAF2);
  160.  
  161. EXTERN_API( short )
  162. SBTrackPopupMenu                (const Rect *            moduleRect,
  163.                                  MenuHandle             theMenu)                            THREEWORDINLINE(0x303C, 0x0408, 0xAAF2);
  164.  
  165. EXTERN_API( short )
  166. SBTrackSlider                    (const Rect *            moduleRect,
  167.                                  short                     ticksOnSlider,
  168.                                  short                     initialValue)                        THREEWORDINLINE(0x303C, 0x0409, 0xAAF2);
  169.  
  170. EXTERN_API( OSErr )
  171. SBShowHelpString                (const Rect *            moduleRect,
  172.                                  StringPtr                 helpString)                            THREEWORDINLINE(0x303C, 0x040A, 0xAAF2);
  173.  
  174. EXTERN_API( short )
  175. SBGetBarGraphWidth                (short                     barCount)                            THREEWORDINLINE(0x303C, 0x010B, 0xAAF2);
  176.  
  177. EXTERN_API( void )
  178. SBDrawBarGraph                    (short                     level,
  179.                                  short                     barCount,
  180.                                  short                     direction,
  181.                                  Point                     barGraphTopLeft)                    THREEWORDINLINE(0x303C, 0x050C, 0xAAF2);
  182.  
  183. EXTERN_API( void )
  184. SBModalDialogInContext            (ModalFilterUPP         filterProc,
  185.                                  short *                itemHit)                            THREEWORDINLINE(0x303C, 0x040D, 0xAAF2);
  186.  
  187. /* The following routines are available in Control Strip 1.2 and later. */
  188. EXTERN_API( OSErr )
  189. SBGetControlStripFontID            (short *                fontID)                                THREEWORDINLINE(0x303C, 0x020E, 0xAAF2);
  190.  
  191. EXTERN_API( OSErr )
  192. SBSetControlStripFontID            (short                     fontID)                                THREEWORDINLINE(0x303C, 0x010F, 0xAAF2);
  193.  
  194. EXTERN_API( OSErr )
  195. SBGetControlStripFontSize        (short *                fontSize)                            THREEWORDINLINE(0x303C, 0x0210, 0xAAF2);
  196.  
  197. EXTERN_API( OSErr )
  198. SBSetControlStripFontSize        (short                     fontSize)                            THREEWORDINLINE(0x303C, 0x0111, 0xAAF2);
  199.  
  200. EXTERN_API( OSErr )
  201. SBGetShowHideHotKey                (short *                modifiers,
  202.                                  unsigned char *        keyCode)                            THREEWORDINLINE(0x303C, 0x0412, 0xAAF2);
  203.  
  204. EXTERN_API( OSErr )
  205. SBSetShowHideHotKey                (short                     modifiers,
  206.                                  unsigned char             keyCode)                            THREEWORDINLINE(0x303C, 0x0213, 0xAAF2);
  207.  
  208. EXTERN_API( OSErr )
  209. SBIsShowHideHotKeyEnabled        (Boolean *                enabled)                            THREEWORDINLINE(0x303C, 0x0214, 0xAAF2);
  210.  
  211. EXTERN_API( OSErr )
  212. SBEnableShowHideHotKey            (Boolean                 enabled)                            THREEWORDINLINE(0x303C, 0x0115, 0xAAF2);
  213.  
  214. /* The following routines are available in Control Strip 1.4 and later. */
  215. EXTERN_API( short )
  216. SBHitTrackSlider                (const Rect *            moduleRect,
  217.                                  short                     ticksOnSlider,
  218.                                  short                     initialValue,
  219.                                  Boolean *                hit)                                THREEWORDINLINE(0x303C, 0x0616, 0xAAF2);
  220.  
  221.  
  222.  
  223. #if PRAGMA_STRUCT_ALIGN
  224.     #pragma options align=reset
  225. #elif PRAGMA_STRUCT_PACKPUSH
  226.     #pragma pack(pop)
  227. #elif PRAGMA_STRUCT_PACK
  228.     #pragma pack()
  229. #endif
  230.  
  231. #ifdef PRAGMA_IMPORT_OFF
  232. #pragma import off
  233. #elif PRAGMA_IMPORT
  234. #pragma import reset
  235. #endif
  236.  
  237. #ifdef __cplusplus
  238. }
  239. #endif
  240.  
  241. #endif /* __CONTROLSTRIP__ */
  242.  
  243.